/*
 * $Id: MainApp.m,v 1.4 2005-11-20 14:22:00 bacon Exp $
 */

#include "MainApp.h"
#include "Globals.h"
#include <xpo/net/Socket.h>

@interface MainApp(private)

- (int) run_main_task;

@end

@implementation MainApp

- (int) run
{
	int n;

	if ([XpSocket startup] == -1) {
		XP_LOG0 (&app_log, XP_NULL, XP_LOG_CRITICAL, 
			XP_TEXT("cannot start up socket subsystem"));
		return -1;
	}

	stop_requested = xp_false;

	XP_LOG0 (&app_log, XP_NULL, XP_LOG_INFO, XP_TEXT("started"));
	n = [self run_main_task];
	XP_LOG0 (&app_log, XP_NULL, XP_LOG_INFO, XP_TEXT("exiting"));

	[XpSocket cleanup];
	return n;
}

- (int) stop
{
	return 0;
}

- (int) stopWith: (int) code
{
	return 0;
}

- (int) returnCode
{
	return ret_code;
}

@end

@implementation MainApp(private)

- (int) run_main_task
{
	xp_printf (XP_TEXT("xxxxxxxxxxxxxxxxxxxxxxxxxx\n"));
	return 0;
}

@end
